function []=create_table(data,filename)
    %filename = "output.csv";
    
    fileID = fopen(filename,'w');
    
    fprintf(fileID, '%s\n', "t_final,x_0,y_0,v_x,v_y,T_constraint,S_constraint_min,S_constraint_max,Z_constraint_min,Z_constraint_max,Point_constraint,UnderFly_constraint");
    n = size(data,1);
    m = size(data,2);
    for i = 1:1:n
        tempstr = "";
        for j = 1:1:m
            if j == 1
                if data{i,j} == -1
                    break;
                end
                tempstr = tempstr + num2str(data{i,j})+',';
            elseif j <= 5
                tempstr = tempstr + num2str(data{i,j})+',';
            elseif j == m
                tempstr = tempstr + my_vec2str(data{i,j});
                fprintf(fileID, '%s\n',tempstr);
            else 
                tempstr = tempstr + my_vec2str(data{i,j})+',';
            end
        end
        
        %tempstr
    end
    fclose(fileID);
end